home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-04
/
ov_all.zip
/
TI681.ASC
< prev
next >
Wrap
Text File
|
1991-09-11
|
5KB
|
199 lines
PRODUCT : ObjectVision NUMBER : 681
VERSION : 1.0
OS : WIN
DATE : September 11, 1991 PAGE : 1/3
TITLE : Running Totals in ObjectVision
ObjectVision requires data for all fields referenced by a formula
before the formula is evaluated. If three fields are referenced
in an @SUM formula the total will remain blank until the user has
supplied data to all three fields. In some cases the user may
not wish to provide answers to all fields, and would like
ObjectVision to perform the calculation anyway. Using decision
trees it is possible to detect when the user presses return on a
field (leaving it blank), it will be assumed that the user is
finished entering data and wishes to proceed to the remaining
fields after the total on the page.
This example uses an order form with four lines, each line has an
item, a quantity a price and a subtotal. After the fourth line
there is a grand total which sums the subtotals. The field names
are: Item1, Item2, Item3, and Item4 for the line items,
quantities are q1, q2, q3, and q4. Prices are p1, p2, p3, p4 and
subtotal fields are s1, s2, s3 and s4. The basic idea is if the
current line item is blank, the current quantity, price and
subtotal will also be blank. The third line checks to see if the
second line is blank, if it is it sets all of its values to blank
as well, the fourth line checks the third line, and so on.
In the decision trees below, some of the conclusions are single
apostrophes. A conclusion of a single apostrophe is the same as
the user pressing return on a field without entering data. When
asked for a conclusion, press Return (or click on OK) and
ObjectVision will place a single apostrophe into the conclusion
dialogue box (or the user may type the apostrophe and press
Return).
Tree for Item3
Branch on Item2
Condition: =""
Conclusion: '
Otherwise +Item3
Tree for Item4
Branch on Item3
Condition: =""
Conclusion: '
Otherwise +Item4
PRODUCT : ObjectVision NUMBER : 681
VERSION : 1.0
OS : WIN
DATE : September 11, 1991 PAGE : 2/3
TITLE : Running Totals in ObjectVision
Tree for q2
Branch on Item2
Condition: =""
Conclusion: '
Otherwise +q2
Tree for q3
Branch on Item3
Condition: =""
Conclusion: '
Otherwise +q3
Tree for q4
Branch on Item4
Condition: =""
Conclusion: '
Otherwise +q4
Tree for p2
Branch on Item2
Condition: =""
Conclusion: '
Otherwise +p2
Tree for p3
Branch on Item3
Condition: =""
Conclusion: '
Otherwise +p3
Tree for p4
Branch on Item4
Condition: =""
Conclusion: '
Otherwise +p4
Tree for s1
+q1*p1
PRODUCT : ObjectVision NUMBER : 681
VERSION : 1.0
OS : WIN
DATE : September 11, 1991 PAGE : 3/3
TITLE : Running Totals in ObjectVision
Tree for s2
Branch on Item2
Condition: =""
Conclusion: '
Otherwise +p2*q2
Tree for s3
Branch on Item3
Condition: =""
Conclusion: '
Otherwise +p3*q3
Tree for s4
Branch on Item4
Condition: =""
Conclusion: '
Otherwise +p4*q4
Tree for Total
+s1+s2+s3+s4
There is a second method for handling the same problem. This
method requires placing a blank default conclusion on each of
items. A blank conclusion is simply a conclusion of an
apostrophe. This apostrophe simulates a return being entered by
the user, and will therefore look like an empty field value. If
the fields on the form have a default value already, the total
will calculate.
The drawbacks to this implementation include the following: The
fields with answers will be skipped since they no longer require
an answer, therefore the user will have to use the mouse, or the
TAB key to make an entry to these fields -- guided completion is
overridden. Another drawback which many find objectionable is
that should the user type information into a field whose default
value is a blank, the field will be "grayed out". More
information about "Overriding values" is described on page 11 of
the ObjectVision Reference Manual. Still some users prefer the
simplicity of this second method so it has been described here.
To avoid confusion on the part of the user about the grayed
fields, a gray rectangle may be placed over the section of the
form which uses default blank values and the end-user will assume
that the form was designed to be gray in these areas.